package com.reggie.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.reggie.dao.OrdersDetailDao;
import com.reggie.pojo.OrderDetail;
import com.reggie.service.OrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderDetailServiceImpl implements OrderDetailService {
    @Autowired
    private OrdersDetailDao ordersDetailDao;
    @Override
    public void addOrderDetail(OrderDetail orderDetail) {
        ordersDetailDao.insert(orderDetail);
    }

    @Override
    public Page<OrderDetail> selectByPage(Integer page, Integer pageSize) {
        Page<OrderDetail> pages = new Page<>();
        ordersDetailDao.selectPage(pages,null);
        return pages;
    }

    @Override
    public List<OrderDetail> selectByOrderId(Long OrderId) {
        return ordersDetailDao.selectByOrderId(OrderId);
    }
}
